

use "$OUTDATA/REDS_sample.dta", clear


global cov "scstbc rural christian hindu"
global cov1 "years_schooling owns_land hh_members"
global cov2 "years_schooling_spouse"

global fe1   "i.state i.yy_1marr"
global fe2   "i.state i.yearb"
global did 	 "i.dow_cohort##i.hindu1"
global cluster "state"

global graph "xlabel(, noticks) ylabel(, nogrid) scheme(s2mono) plotregion(fcolor(white) lcolor(white) margin(small)) graphregion(fcolor(white) lcolor(white) ifcolor(white) ilcolor(white))"


* Labels for Tables

label var dow_99 "\shortstack{Gross \\ Dowry}"
label var downet_99 "\shortstack{Net \\ Dowry}"
label var zdow "\shortstack{Zero \\Dowry}"
label var missingdow "\shortstack{Missing \\Dowry}"


*** Table A1: Dowries ****

eststo clear

qui reg dow_99 $did $cov $fe2, r cl($cluster )
gen esample = e(sample)

foreach y in dow_99 downet_99 {
	eststo: reg `y' $did $cov $fe2  , r cl($cluster )
	qui sum `y' if e(sample)==1
	estadd scalar m =r(mean)


	}
	
	eststo: reg dow_99 $did $cov $fe2 if dow_99>0 , r cl($cluster )
	qui sum dow_99 if e(sample)==1
	estadd scalar m =r(mean)
	
	eststo: reg downet_99 $did $cov $fe2 if downet_99!=0 , r cl($cluster )
	qui sum downet_99 if e(sample)==1
	estadd scalar m =r(mean)

	
	eststo: reg zdow $did $cov $fe2, r cl($cluster )
	qui sum zdow if e(sample)==1
	estadd scalar m =r(mean)

	
	eststo: reg missingdow $did $cov $fe2 , r cl($cluster )
	qui sum missingdow if e(sample)==1
	estadd scalar m =r(mean)
	
	
* Matching

	logit hindu1 $cov $cov1 $cov2 yearb 
	predict pscore, pr
	sum pscore

	psmatch2 hindu1, pscore(pscore) noreplace n(1) 

	gen pair = _id if _treated==0 
	replace pair = _n1 if _treated==1
	bysort pair: egen paircount = count(pair)

	eststo: reg dow_99 $did $cov $fe2 if paircount == 2 , r cl($cluster )
	qui sum dow_99 if e(sample)==1
	estadd scalar m =r(mean)
	eststo: reg zdow $did $cov $fe2 if paircount == 2, r cl($cluster )
	qui sum zdow if e(sample)==1
	estadd scalar m =r(mean)

esttab using "$OUTTEX/REDS_dowry.tex", ///
booktabs nonotes replace indicate("\hline\vspace{-3mm} \\ \vspace{-3mm}  Individual Controls = $cov " " \vspace{-3mm} State FE = *.state " " Year of Birth FE = *.yearb ", labels("Yes" "$-$") ) ///
keep(1.dow_cohort#1.hindu1) ///
label interaction(" \$\times\$ ") substitute("=1" "") ///
stats(N m r2 m1, labels("Obs." "Mean Dep. Var." "R sq." ) fmt(%9.0fc %9.3fc))   ///
se star(* 0.10 ** 0.05 *** 0.01)  b(%9.3fc) se(%9.3fc) 

esttab using "$OUTDIR/REDS_dowry.tex", /// For Paper
booktabs nonotes replace indicate("\hline\vspace{-3mm} \\ \vspace{-3mm}  Individual Controls = $cov " " \vspace{-3mm} State FE = *.state " " Year of Birth FE = *.yearb ", labels("Yes" "$-$") ) ///
keep(1.dow_cohort#1.hindu1) ///
label interaction(" \$\times\$ ") substitute("=1" "") ///
stats(N r2 m m1, labels("Obs." "R sq." "Mean Dep. Var." ) fmt(%9.0fc %9.3fc))   ///
se star(* 0.10 ** 0.05 *** 0.01)  b(%9.3fc) se(%9.3fc) 

